<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpixelformat.cpp -->
  <title>QPixelFormat Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPixelFormat</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPixelFormat Class</h1>
<!-- $$$QPixelFormat-brief -->
<p>QPixelFormat is a class for describing different pixel layouts in graphics buffers. <a href="#details">More...</a></p>
<!-- @@@QPixelFormat -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPixelFormat&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.4</td></tr></table></div><p>This class was introduced in Qt 5.4.</p>
<ul>
<li><a href="qpixelformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#AlphaPosition-enum">AlphaPosition</a></b> { AtBeginning, AtEnd }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#AlphaPremultiplied-enum">AlphaPremultiplied</a></b> { NotPremultiplied, Premultiplied }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#AlphaUsage-enum">AlphaUsage</a></b> { IgnoresAlpha, UsesAlpha }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#ByteOrder-enum">ByteOrder</a></b> { LittleEndian, BigEndian, CurrentSystemEndian }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#ColorModel-enum">ColorModel</a></b> { RGB, BGR, Indexed, Grayscale, CMYK, &hellip;, Alpha }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#TypeInterpretation-enum">TypeInterpretation</a></b> { UnsignedInteger, UnsignedShort, UnsignedByte, FloatingPoint }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#YUVLayout-enum">YUVLayout</a></b> { YUV444, YUV422, YUV411, YUV420P, YUV420SP, &hellip;, Y16 }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#QPixelFormat-1">QPixelFormat</a></b>(QPixelFormat::ColorModel <i>colorModel</i>, uchar <i>firstSize</i>, uchar <i>secondSize</i>, uchar <i>thirdSize</i>, uchar <i>fourthSize</i>, uchar <i>fifthSize</i>, uchar <i>alphaSize</i>, QPixelFormat::AlphaUsage <i>alphaUsage</i>, QPixelFormat::AlphaPosition <i>alphaPosition</i>, QPixelFormat::AlphaPremultiplied <i>premultiplied</i>, QPixelFormat::TypeInterpretation <i>typeInterpretation</i>, QPixelFormat::ByteOrder <i>byteOrder</i> = ..., uchar <i>subEnum</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::AlphaPosition </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#alphaPosition">alphaPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#alphaSize">alphaSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::AlphaUsage </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#alphaUsage">alphaUsage</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#bitsPerPixel">bitsPerPixel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#blackSize">blackSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#blueSize">blueSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#brightnessSize">brightnessSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::ByteOrder </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#byteOrder">byteOrder</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#channelCount">channelCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::ColorModel </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#colorModel">colorModel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#cyanSize">cyanSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#greenSize">greenSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#hueSize">hueSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#lightnessSize">lightnessSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#magentaSize">magentaSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::AlphaPremultiplied </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#premultiplied">premultiplied</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#redSize">redSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#saturationSize">saturationSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::TypeInterpretation </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#typeInterpretation">typeInterpretation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uchar </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#yellowSize">yellowSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat::YUVLayout </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#yuvLayout">yuvLayout</a></b>() const</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatAlpha">qPixelFormatAlpha</a></b>(uchar <i>channelSize</i>, QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatCmyk">qPixelFormatCmyk</a></b>(uchar <i>channelSize</i>, uchar <i>alphaSize</i> = ..., QPixelFormat::AlphaUsage <i>alphaUsage</i> = ..., QPixelFormat::AlphaPosition <i>alphaPosition</i> = ..., QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatGrayscale">qPixelFormatGrayscale</a></b>(uchar <i>channelSize</i>, QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatHsl">qPixelFormatHsl</a></b>(uchar <i>channelSize</i>, uchar <i>alphaSize</i> = ..., QPixelFormat::AlphaUsage <i>alphaUsage</i> = ..., QPixelFormat::AlphaPosition <i>alphaPosition</i> = ..., QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatHsv">qPixelFormatHsv</a></b>(uchar <i>channelSize</i>, uchar <i>alphaSize</i> = ..., QPixelFormat::AlphaUsage <i>alphaUsage</i> = ..., QPixelFormat::AlphaPosition <i>alphaPosition</i> = ..., QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatRgba">qPixelFormatRgba</a></b>(uchar <i>redSize</i>, uchar <i>greenSize</i>, uchar <i>blueSize</i>, uchar <i>alphaSize</i>, QPixelFormat::AlphaUsage <i>alphaUsage</i>, QPixelFormat::AlphaPosition <i>alphaPosition</i>, QPixelFormat::AlphaPremultiplied <i>premultiplied</i> = ..., QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qpixelformat.html#qPixelFormatYuv">qPixelFormatYuv</a></b>(QPixelFormat::YUVLayout <i>yuvLayout</i>, uchar <i>alphaSize</i> = ..., QPixelFormat::AlphaUsage <i>alphaUsage</i> = ..., QPixelFormat::AlphaPosition <i>alphaPosition</i> = ..., QPixelFormat::AlphaPremultiplied <i>premultiplied</i> = ..., QPixelFormat::TypeInterpretation <i>typeInterpretation</i> = ..., QPixelFormat::ByteOrder <i>byteOrder</i> = ...)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPixelFormat-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>In Qt there is a often a need to represent the layout of the pixels in a graphics buffer. Internally QPixelFormat stores everything in a 64 bit datastructure. This gives performance but also some limitations.</p>
<p>QPixelFormat can describe 5 color channels and 1 alpha channel, each can use 6 bits to describe the size of the color channel.</p>
<p>The position of the alpha channel is described with a separate enum. This is to make it possible to describe <a href="qimage.html">QImage</a> formats like ARGB32, and also describe typical OpenGL formats like RBGA8888.</p>
<p>How pixels are suppose to be read is determined by the <a href="qpixelformat.html#TypeInterpretation-enum">TypeInterpretation</a> enum. It describes if color values are suppose to be read byte per byte, or if a pixel is suppose to be read as a complete int and then masked.</p>
<p>There is no support for describing YUV's macro pixels. Instead a list of YUV formats has been made. When a QPixelFormat is describing a YUV format, the <a href="qpixelformat.html#bitsPerPixel">bitsPerPixel</a> value has been deduced by the YUV Layout enum. Also, the color channels should all be set to zero except the fifth color channel that should store the <a href="qpixelformat.html#bitsPerPixel">bitsPerPixel</a> value.</p>
</div>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">TypeInterpretation</a>.</p>
<!-- @@@QPixelFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AlphaPosition$$$AtBeginning$$$AtEnd -->
<h3 class="fn" id="AlphaPosition-enum"><a name="AlphaPosition-enum"></a>enum QPixelFormat::<span class="name">AlphaPosition</span></h3>
<p>This enum type is used to describe the alpha channels position relative to the color channels.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::AtBeginning</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The alpha channel will be put in front of the color channels . E.g&#x2e; ARGB.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::AtEnd</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The alpha channel will be put in the back of the color channels. E.g&#x2e; RGBA.</td></tr>
</table></div>
<!-- @@@AlphaPosition -->
<!-- $$$AlphaPremultiplied$$$NotPremultiplied$$$Premultiplied -->
<h3 class="fn" id="AlphaPremultiplied-enum"><a name="AlphaPremultiplied-enum"></a>enum QPixelFormat::<span class="name">AlphaPremultiplied</span></h3>
<p>This enum type describes the boolean state if the alpha channel is multiplied into the color channels or not.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::NotPremultiplied</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The alpha channel is not multiplied into the color channels.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Premultiplied</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The alpha channel is multiplied into the color channels.</td></tr>
</table></div>
<!-- @@@AlphaPremultiplied -->
<!-- $$$AlphaUsage$$$UsesAlpha$$$IgnoresAlpha -->
<h3 class="fn" id="AlphaUsage-enum"><a name="AlphaUsage-enum"></a>enum QPixelFormat::<span class="name">AlphaUsage</span></h3>
<p>This enum describes if the alpha channel is used or not. Sometimes the pixelformat will have a size for the alpha channel, but the pixel format does actually not use the alpha channel. For example RGB32 is such a format. The RGB channels are 8 bits each, and there is no alpha channel. But the complete size for each pixel is 32. Therefore the alpha channel size is 8, but the alpha channel is ignored. Its important to note that in such situations the position of the alpha channel is significant.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::IgnoresAlpha</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The alpha channel is not used.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::UsesAlpha</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The alpha channel is used.</td></tr>
</table></div>
<!-- @@@AlphaUsage -->
<!-- $$$ByteOrder$$$LittleEndian$$$BigEndian$$$CurrentSystemEndian -->
<h3 class="fn" id="ByteOrder-enum"><a name="ByteOrder-enum"></a>enum QPixelFormat::<span class="name">ByteOrder</span></h3>
<p>This enum describes the ByteOrder of the pixel format. This enum is mostly ignored but have some use cases for YUV formats. BGR formats have their own color model, and should not be described by using the opposite endianness on an RGB format.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::LittleEndian</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The byte order is little endian.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::BigEndian</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The byte order is big endian.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::CurrentSystemEndian</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">This enum will not be stored, but is converted in the constructor to the endian enum that matches the enum of the current system.</td></tr>
</table></div>
<!-- @@@ByteOrder -->
<!-- $$$ColorModel$$$RGB$$$BGR$$$Indexed$$$Grayscale$$$CMYK$$$HSL$$$HSV$$$YUV$$$Alpha -->
<h3 class="fn" id="ColorModel-enum"><a name="ColorModel-enum"></a>enum QPixelFormat::<span class="name">ColorModel</span></h3>
<p>This enum type is used to describe the color model of the pixelformat. Alpha was added in 5.5&#x2e;</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::RGB</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The color model is RGB.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::BGR</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">This is logically the opposite endian version of RGB. However, for ease of use it has its own model.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Indexed</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The color model uses a color palette.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Grayscale</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The color model is Grayscale.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::CMYK</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The color model is CMYK.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::HSL</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The color model is HSL.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::HSV</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The color model is HSV.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">The color model is YUV.</td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Alpha</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">There is no color model, only alpha is used.</td></tr>
</table></div>
<!-- @@@ColorModel -->
<!-- $$$TypeInterpretation$$$UnsignedInteger$$$UnsignedShort$$$UnsignedByte$$$FloatingPoint -->
<h3 class="fn" id="TypeInterpretation-enum"><a name="TypeInterpretation-enum"></a>enum QPixelFormat::<span class="name">TypeInterpretation</span></h3>
<p>This enum describes how each pixel is interpreted. If a pixel is read as a full 32 bit unsigned integer and then each channel is masked out, or if each byte is read as unsigned char values. Typically <a href="qimage.html">QImage</a> formats interpret one pixel as an unsigned integer and then the color channels are masked out. OpenGL on the other hand typically interpreted pixels &quot;one byte after the other&quot;, Ie. unsigned byte.</p>
<p><a href="qimage.html">QImage</a> also have the format Format_RGBA8888 (and its derivatives), where the pixels are interpreted as unsigned bytes. OpenGL has extensions that makes it possible to upload pixel buffers in an unsigned integer format.</p>
<p class="centerAlign"><img src="images/qpixelformat-argb32buffer.png" alt="An unsigned integer ARGB32 pixel." /></p><p>The image above shows a ARGB pixel in memory read as an unsigned integer. However, if this pixel was read byte for byte on a little endian system the first byte would be the byte containing the B-channel. The next byte would be the G-channel, then the R-channel and finally the A-channel. This shows that on little endian systems, how each pixel is interpreted is significant for integer formats. This is not the case on big endian systems.</p>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::UnsignedInteger</code></td><td class="topAlign tblval"><code>0</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::UnsignedShort</code></td><td class="topAlign tblval"><code>1</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::UnsignedByte</code></td><td class="topAlign tblval"><code>2</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::FloatingPoint</code></td><td class="topAlign tblval"><code>3</code></td></tr>
</table></div>
<!-- @@@TypeInterpretation -->
<!-- $$$YUVLayout$$$YUV444$$$YUV422$$$YUV411$$$YUV420P$$$YUV420SP$$$YV12$$$UYVY$$$YUYV$$$NV12$$$NV21$$$IMC1$$$IMC2$$$IMC3$$$IMC4$$$Y8$$$Y16 -->
<h3 class="fn" id="YUVLayout-enum"><a name="YUVLayout-enum"></a>enum QPixelFormat::<span class="name">YUVLayout</span></h3>
<p>YUV is not represented by describing the size of the color channels. This is because YUV often use macro pixels, making the concept of sperate color channels invalid. Instead the different YUV layouts are described with this enum.</p>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV444</code></td><td class="topAlign tblval"><code>0</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV422</code></td><td class="topAlign tblval"><code>1</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV411</code></td><td class="topAlign tblval"><code>2</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV420P</code></td><td class="topAlign tblval"><code>3</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUV420SP</code></td><td class="topAlign tblval"><code>4</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YV12</code></td><td class="topAlign tblval"><code>5</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::UYVY</code></td><td class="topAlign tblval"><code>6</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::YUYV</code></td><td class="topAlign tblval"><code>7</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::NV12</code></td><td class="topAlign tblval"><code>8</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::NV21</code></td><td class="topAlign tblval"><code>9</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::IMC1</code></td><td class="topAlign tblval"><code>10</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::IMC2</code></td><td class="topAlign tblval"><code>11</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::IMC3</code></td><td class="topAlign tblval"><code>12</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::IMC4</code></td><td class="topAlign tblval"><code>13</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Y8</code></td><td class="topAlign tblval"><code>14</code></td></tr>
<tr><td class="topAlign"><code>QPixelFormat::Y16</code></td><td class="topAlign tblval"><code>15</code></td></tr>
</table></div>
<!-- @@@YUVLayout -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPixelFormat$$$QPixelFormatQPixelFormat::ColorModelucharucharucharucharucharucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::AlphaPremultipliedQPixelFormat::TypeInterpretationQPixelFormat::ByteOrderuchar -->
<h3 class="fn" id="QPixelFormat-1"><a name="QPixelFormat-1"></a>QPixelFormat::<span class="name">QPixelFormat</span>(<span class="type"><a href="qpixelformat.html#ColorModel-enum">QPixelFormat::ColorModel</a></span> <i>colorModel</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>firstSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>secondSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>thirdSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>fourthSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>fifthSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i>, <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i>, <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i>, <span class="type"><a href="qpixelformat.html#AlphaPremultiplied-enum">QPixelFormat::AlphaPremultiplied</a></span> <i>premultiplied</i>, <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i>, <span class="type"><a href="qpixelformat.html#ByteOrder-enum">QPixelFormat::ByteOrder</a></span> <i>byteOrder</i> = ..., <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>subEnum</i> = ...)</h3>
<p>Creates a QPixelFormat which assigns its data to the attributes. <i>colorModel</i> will be put into a buffer which is 4 bits long.</p>
<p><i>firstSize</i> <i>secondSize</i> <i>thirdSize</i> <i>fourthSize</i> <i>fifthSize</i> <i>alphaSize</i> are all meant to represent the size of a channel. The channels will be used for different uses dependent on the <i>colorModel</i>. For RGB the firstSize will represent the Red channel. On CMYK it will represent the value of the Cyan channel.</p>
<p><i>alphaUsage</i> represents if the alpha channel is used or not.</p>
<p><i>alphaPosition</i> is the position of the alpha channel.</p>
<p><i>premultiplied</i> represents if the alpha channel is already multiplied with the color channels.</p>
<p><i>typeInterpretation</i> is how the pixel is interpreted.</p>
<p><i>byteOrder</i> represents the endianness of the pixelformat. This defaults to <a href="qpixelformat.html#ByteOrder-enum">CurrentSystemEndian</a>.</p>
<p><i>subEnum</i> is used for colorModels that have to store some extra information with supplying an extra enum. This is used by YUV to store the YUV type The default value is 0.</p>
<!-- @@@QPixelFormat -->
<!-- $$$QPixelFormat[overload1]$$$QPixelFormat -->
<h3 class="fn" id="QPixelFormat"><a name="QPixelFormat"></a>QPixelFormat::<span class="name">QPixelFormat</span>()</h3>
<p>Creates a null pixelformat. This format maps to <a href="qimage.html#Format-enum">QImage::Format_Invalid</a>.</p>
<!-- @@@QPixelFormat -->
<!-- $$$alphaPosition[overload1]$$$alphaPosition -->
<h3 class="fn" id="alphaPosition"><a name="alphaPosition"></a><span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> QPixelFormat::<span class="name">alphaPosition</span>() const</h3>
<p>Accessor function for alphaPosition.</p>
<!-- @@@alphaPosition -->
<!-- $$$alphaSize[overload1]$$$alphaSize -->
<h3 class="fn" id="alphaSize"><a name="alphaSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">alphaSize</span>() const</h3>
<p>Accessor function for the alpha channel size.</p>
<!-- @@@alphaSize -->
<!-- $$$alphaUsage[overload1]$$$alphaUsage -->
<h3 class="fn" id="alphaUsage"><a name="alphaUsage"></a><span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> QPixelFormat::<span class="name">alphaUsage</span>() const</h3>
<p>Accessor function for alphaUsage.</p>
<!-- @@@alphaUsage -->
<!-- $$$bitsPerPixel[overload1]$$$bitsPerPixel -->
<h3 class="fn" id="bitsPerPixel"><a name="bitsPerPixel"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">bitsPerPixel</span>() const</h3>
<p>Accessor function for the bits used per pixel. This function returns the sum of the color channels + the size of the alpha channel.</p>
<!-- @@@bitsPerPixel -->
<!-- $$$blackSize[overload1]$$$blackSize -->
<h3 class="fn" id="blackSize"><a name="blackSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">blackSize</span>() const</h3>
<p>Accessor function for the black/key color channel.</p>
<!-- @@@blackSize -->
<!-- $$$blueSize[overload1]$$$blueSize -->
<h3 class="fn" id="blueSize"><a name="blueSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">blueSize</span>() const</h3>
<p>Accessor function for the size of the blue color channel.</p>
<!-- @@@blueSize -->
<!-- $$$brightnessSize[overload1]$$$brightnessSize -->
<h3 class="fn" id="brightnessSize"><a name="brightnessSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">brightnessSize</span>() const</h3>
<p>Accessor function for the brightness channel size.</p>
<!-- @@@brightnessSize -->
<!-- $$$byteOrder[overload1]$$$byteOrder -->
<h3 class="fn" id="byteOrder"><a name="byteOrder"></a><span class="type"><a href="qpixelformat.html#ByteOrder-enum">QPixelFormat::ByteOrder</a></span> QPixelFormat::<span class="name">byteOrder</span>() const</h3>
<p>The byte order is almost always set the byte order of the current system. However, it can be useful to describe some YUV formats. This function should never return <a href="qpixelformat.html#ByteOrder-enum">QPixelFormat::CurrentSystemEndian</a> as this value is translated to a endian value in the constructor.</p>
<!-- @@@byteOrder -->
<!-- $$$channelCount[overload1]$$$channelCount -->
<h3 class="fn" id="channelCount"><a name="channelCount"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">channelCount</span>() const</h3>
<p>Accessor function for getting the channelCount. Channel Count is deduced by color channels with a size &gt; 0 and if the size of the alpha channel is &gt; 0.</p>
<!-- @@@channelCount -->
<!-- $$$colorModel[overload1]$$$colorModel -->
<h3 class="fn" id="colorModel"><a name="colorModel"></a><span class="type"><a href="qpixelformat.html#ColorModel-enum">QPixelFormat::ColorModel</a></span> QPixelFormat::<span class="name">colorModel</span>() const</h3>
<p>Accessor function for getting the colorModel.</p>
<!-- @@@colorModel -->
<!-- $$$cyanSize[overload1]$$$cyanSize -->
<h3 class="fn" id="cyanSize"><a name="cyanSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">cyanSize</span>() const</h3>
<p>Accessor function for the cyan color channel.</p>
<!-- @@@cyanSize -->
<!-- $$$greenSize[overload1]$$$greenSize -->
<h3 class="fn" id="greenSize"><a name="greenSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">greenSize</span>() const</h3>
<p>Accessor function for the size of the green color channel.</p>
<!-- @@@greenSize -->
<!-- $$$hueSize[overload1]$$$hueSize -->
<h3 class="fn" id="hueSize"><a name="hueSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">hueSize</span>() const</h3>
<p>Accessor function for the hue channel size.</p>
<!-- @@@hueSize -->
<!-- $$$lightnessSize[overload1]$$$lightnessSize -->
<h3 class="fn" id="lightnessSize"><a name="lightnessSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">lightnessSize</span>() const</h3>
<p>Accessor function for the lightness channel size.</p>
<!-- @@@lightnessSize -->
<!-- $$$magentaSize[overload1]$$$magentaSize -->
<h3 class="fn" id="magentaSize"><a name="magentaSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">magentaSize</span>() const</h3>
<p>Accessor function for the megenta color channel.</p>
<!-- @@@magentaSize -->
<!-- $$$premultiplied[overload1]$$$premultiplied -->
<h3 class="fn" id="premultiplied"><a name="premultiplied"></a><span class="type"><a href="qpixelformat.html#AlphaPremultiplied-enum">QPixelFormat::AlphaPremultiplied</a></span> QPixelFormat::<span class="name">premultiplied</span>() const</h3>
<p>Accessor function for the <a href="qpixelformat.html#AlphaPremultiplied-enum">AlphaPremultiplied</a> enum. This indicates if the alpha channel is multiplied in to the color channels.</p>
<!-- @@@premultiplied -->
<!-- $$$redSize[overload1]$$$redSize -->
<h3 class="fn" id="redSize"><a name="redSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">redSize</span>() const</h3>
<p>Accessor function for the size of the red color channel.</p>
<!-- @@@redSize -->
<!-- $$$saturationSize[overload1]$$$saturationSize -->
<h3 class="fn" id="saturationSize"><a name="saturationSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">saturationSize</span>() const</h3>
<p>Accessor function for the saturation channel size.</p>
<!-- @@@saturationSize -->
<!-- $$$typeInterpretation[overload1]$$$typeInterpretation -->
<h3 class="fn" id="typeInterpretation"><a name="typeInterpretation"></a><span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> QPixelFormat::<span class="name">typeInterpretation</span>() const</h3>
<p>Accessor function for the type representation of a color channel or a pixel.</p>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">TypeInterpretation</a>.</p>
<!-- @@@typeInterpretation -->
<!-- $$$yellowSize[overload1]$$$yellowSize -->
<h3 class="fn" id="yellowSize"><a name="yellowSize"></a><span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> QPixelFormat::<span class="name">yellowSize</span>() const</h3>
<p>Accessor function for the yellow color channel.</p>
<!-- @@@yellowSize -->
<!-- $$$yuvLayout[overload1]$$$yuvLayout -->
<h3 class="fn" id="yuvLayout"><a name="yuvLayout"></a><span class="type"><a href="qpixelformat.html#YUVLayout-enum">QPixelFormat::YUVLayout</a></span> QPixelFormat::<span class="name">yuvLayout</span>() const</h3>
<p>Accessor function for the <a href="qpixelformat.html#YUVLayout-enum">YUVLayout</a>. It is difficult to describe the color channels of a YUV pixel format since YUV color model uses macro pixels. Instead the layout of the pixels are stored as an enum.</p>
<!-- @@@yuvLayout -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qPixelFormatAlpha[overload1]$$$qPixelFormatAlphaucharQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatAlpha"><a name="qPixelFormatAlpha"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatAlpha</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>channelSize</i>, <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function for creating an Alpha format. A mask format can be described by passing 1 to <i>channelSize</i>. Its also possible to define very accurate alpha formats using doubles to describe each pixel by passing 8 as <i>channelSize</i> and <a href="qpixelformat.html#TypeInterpretation-enum">FloatingPoint</a> as <i>typeInterpretation</i>.</p>
<p>This function was introduced in Qt 5.5.</p>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a>.</p>
<!-- @@@qPixelFormatAlpha -->
<!-- $$$qPixelFormatCmyk[overload1]$$$qPixelFormatCmykucharucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatCmyk"><a name="qPixelFormatCmyk"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatCmyk</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>channelSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i> = ..., <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function for creating CMYK formats. The channel count will be 4 or 5 depending on if <i>alphaSize</i> is bigger than zero or not. The CMYK color channels will all be set to the value of <i>channelSize</i>.</p>
<p><i>alphaUsage</i> <i>alphaPosition</i> and <i>typeInterpretation</i> are all accessible with the accessors with the same name.</p>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a>.</p>
<!-- @@@qPixelFormatCmyk -->
<!-- $$$qPixelFormatGrayscale[overload1]$$$qPixelFormatGrayscaleucharQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatGrayscale"><a name="qPixelFormatGrayscale"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatGrayscale</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>channelSize</i>, <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function for creating a Grayscale format. Monochrome formats can be described by passing 1 to <i>channelSize</i>. Its also possible to define very accurate grayscale formats using doubles to describe each pixel by passing 8 as <i>channelSize</i> and <a href="qpixelformat.html#TypeInterpretation-enum">FloatingPoint</a> as <i>typeInterpretation</i>.</p>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a>.</p>
<!-- @@@qPixelFormatGrayscale -->
<!-- $$$qPixelFormatHsl[overload1]$$$qPixelFormatHslucharucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatHsl"><a name="qPixelFormatHsl"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatHsl</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>channelSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i> = ..., <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function for creating HSL formats. The channel count will be 3 or 4 depending on if <i>alphaSize</i> is bigger than 0.</p>
<p><i>channelSize</i> will set the <a href="qpixelformat.html#hueSize">hueSize</a> <a href="qpixelformat.html#saturationSize">saturationSize</a> and <a href="qpixelformat.html#lightnessSize">lightnessSize</a> to the same value.</p>
<p><i>alphaUsage</i> <i>alphaPosition</i> and <i>typeInterpretation</i> are all accessible with the accessors with the same name.</p>
<!-- @@@qPixelFormatHsl -->
<!-- $$$qPixelFormatHsv[overload1]$$$qPixelFormatHsvucharucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatHsv"><a name="qPixelFormatHsv"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatHsv</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>channelSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i> = ..., <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function for creating HSV formats. The channel count will be 3 or 4 depending on if <i>alphaSize</i> is bigger than 0.</p>
<p><i>channelSize</i> will set the <a href="qpixelformat.html#hueSize">hueSize</a> <a href="qpixelformat.html#saturationSize">saturationSize</a> and <a href="qpixelformat.html#brightnessSize">brightnessSize</a> to the same value.</p>
<p><i>alphaUsage</i> <i>alphaPosition</i> and <i>typeInterpretation</i> are all accessible with the accessors with the same name.</p>
<!-- @@@qPixelFormatHsv -->
<!-- $$$qPixelFormatRgba[overload1]$$$qPixelFormatRgbaucharucharucharucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::AlphaPremultipliedQPixelFormat::TypeInterpretation -->
<h3 class="fn" id="qPixelFormatRgba"><a name="qPixelFormatRgba"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatRgba</span>(<span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>redSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>greenSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>blueSize</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i>, <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i>, <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i>, <span class="type"><a href="qpixelformat.html#AlphaPremultiplied-enum">QPixelFormat::AlphaPremultiplied</a></span> <i>premultiplied</i> = ..., <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ...)</h3>
<p>Constructor function making an RGB pixelformat. <i>redSize</i> <i>greenSize</i> <i>blueSize</i> represent the size of each color channel. <i>alphaSize</i> describes the alpha channel size and its position is described with <i>alphaPosition</i>. <i>alphaUsage</i> is used to determine if the alpha channel is used or not. Setting the alpha channel size to 8 and <a href="qpixelformat.html#alphaUsage">alphaUsage</a> to <a href="qpixelformat.html#AlphaUsage-enum">IgnoresAlpha</a> is how it is possible to create a 32 bit format where the rgb channels only use 24 bits combined. <i>premultiplied</i> <i>typeInterpretation</i> are accessible with accessors with the same name.</p>
<p><b>See also </b><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a>.</p>
<!-- @@@qPixelFormatRgba -->
<!-- $$$qPixelFormatYuv[overload1]$$$qPixelFormatYuvQPixelFormat::YUVLayoutucharQPixelFormat::AlphaUsageQPixelFormat::AlphaPositionQPixelFormat::AlphaPremultipliedQPixelFormat::TypeInterpretationQPixelFormat::ByteOrder -->
<h3 class="fn" id="qPixelFormatYuv"><a name="qPixelFormatYuv"></a><span class="type"><a href="qpixelformat.html#QPixelFormat">QPixelFormat</a></span> <span class="name">qPixelFormatYuv</span>(<span class="type"><a href="qpixelformat.html#YUVLayout-enum">QPixelFormat::YUVLayout</a></span> <i>yuvLayout</i>, <span class="type"><a href="../qtcore/qtglobal.html#uchar-typedef">uchar</a></span> <i>alphaSize</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaUsage-enum">QPixelFormat::AlphaUsage</a></span> <i>alphaUsage</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaPosition-enum">QPixelFormat::AlphaPosition</a></span> <i>alphaPosition</i> = ..., <span class="type"><a href="qpixelformat.html#AlphaPremultiplied-enum">QPixelFormat::AlphaPremultiplied</a></span> <i>premultiplied</i> = ..., <span class="type"><a href="qpixelformat.html#TypeInterpretation-enum">QPixelFormat::TypeInterpretation</a></span> <i>typeInterpretation</i> = ..., <span class="type"><a href="qpixelformat.html#ByteOrder-enum">QPixelFormat::ByteOrder</a></span> <i>byteOrder</i> = ...)</h3>
<p>Constructor function for creating a <a href="qpixelformat.html">QPixelFormat</a> describing a YUV format with <i>yuvLayout</i>. <i>alphaSize</i> describes the size of a potential alpha channel and is position is described with <i>alphaPosition</i>. The &quot;first&quot; &quot;second&quot; .. &quot;fifth&quot; channels are all set to 0. <i>alphaUsage</i> <i>premultiplied</i> <i>typeInterpretation</i> and <i>byteOrder</i> will work as with other formats.</p>
<!-- @@@qPixelFormatYuv -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
